<?php
if( !defined( '_VALID_MOS' ) && !defined( '_JEXEC' ) ) die( 'Direct Access to '.basename(__FILE__).' is not allowed.' );
/**
* @version		$Id: helper.php
* @package		VirtueMart
* @subpackage modules
* @copyright	Copyright (C) 2012 Peter Osipof, 2009 Grigory Fedorinov, 2007 - 2008 Greg Perkins, 2007 -2008 YOOtheme Ltd. & Co. KG. All rights reserved.
* @license		GNU/GPL, http://www.gnu.org/copyleft/gpl.html
*
* VirtueMart is free software. This version may have been modified pursuant
* to the GNU General Public License, and as distributed it includes or
* is derivative of works licensed under the GNU General Public License or
* other free or open source software licenses.
* See /administrator/components/com_virtuemart/COPYRIGHT.php for copyright notices and details.
*
* http://virtuemart.net
*/
?>
<?php

// count instances
if (!isset($GLOBALS['vm_logins'])) {
	$GLOBALS['vm_logins'] = 1;
} else {
	$GLOBALS['vm_logins']++;
}

// Include the syndicate functions only once
require_once (dirname(__FILE__).DS.'helper.php');
require_once( JPATH_BASE.DS."components".DS."com_virtuemart".DS."virtuemart_parser.php" );
global $mm_action_url, $sess, $VM_LANG;

$params->def('greeting', 1);

$type 	= modVMloginHelper::getType();
$return	= modVMloginHelper::getReturnURL($params, $type);

$user =& JFactory::getUser();

// init vars
$style                 = $params->get('style', 'default');
$pretext               = $params->get('pretext', '');
$posttext              = $params->get('posttext', '');
$text_mode             = $params->get('text_mode', 'input');
$login_button          = $params->get('login_button', 'icon');
$logout_button         = $params->get('logout_button', 'text');
$auto_remember         = $params->get('auto_remember', '1');
$lost_password         = $params->get('lost_password', '1');
$lost_username         = $params->get('lost_username', '1');
$registration          = $params->get('registration', '1');

$show_adminlink        = $params->get('show_adminlink', 'yes' );
$download_button       = $params->get('download_button', 'text');
$admin_button          = $params->get('admin_button', 'text');
$accountlink_button    = $params->get('accountlink_button', 'text');

$my =& JFactory::getUser();
// Registration URL
$registration_url = $sess->url( SECUREURL.'index.php?option=com_virtuemart&amp;page=shop.registration' );

// css parameters
$vmlogin_id           = $GLOBALS['vm_logins'];

$module_base           = JURI::base() . 'modules/mod_virtuemart_login/';

switch ($style) {
	case "niftydefault":
		require(JModuleHelper::getLayoutPath('mod_virtuemart_login', 'niftydefault'));
   		break;
	case "niftyquick":
		require(JModuleHelper::getLayoutPath('mod_virtuemart_login', 'niftyquick'));
   		break;
	case "quick":
		require(JModuleHelper::getLayoutPath('mod_virtuemart_login', 'quick'));
   		break;
	default:
		require(JModuleHelper::getLayoutPath('mod_virtuemart_login', 'default'));
}

$document =& JFactory::getDocument();
$document->addStyleSheet($module_base . 'mod_virtuemart_login.css.php');